<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv ="proma" content = "no-cache"/>
    <meta http-equiv="cache-control" content="no cache" />
    <meta http-equiv="expires" content="0" />

    <base th:href="@{/}"/>
    <script type="text/javascript" src="js/studentPage.js"></script>
</head>
<body>
<div th:fragment="studentContent"  style="height: 380px">
    <table id="classTable" class="table table-hover" style="height: 1%;">
        <thead>
        <tr>
            <th style="width: 10%">
                <input onclick="studentPage.selectAll()" type="checkbox"/>
            </th>
            <th style="width: 20%">序号</th>
            <th style="width: 20%">班级名称</th>
            <th style="width: 30%">班级人数</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody th:fragment="studentContent">
        <th:block th:if="${pageVO==null || pageVO.params.size()==0}">
            <tr >
                <td align="center" colspan="5" >没有任何查询记录</td>
            </tr>
        </th:block>

        <th:block th:if="${pageVO!=null && pageVO.params.size()!=0}">
            <tr th:each="studentList:${pageVO.params}">
                <th style="width: 10%">
                    <input  type="checkbox"th:value="${studentList.grade+'-'+studentList.major+'-'+studentList.class_no}"/>
                </th>
                <th style="width: 20%" th:text="${studentListStat.index+1}"></th>
                <th style="width: 20%" th:text="${studentList.grade+'-'+studentList.major+'-'+studentList.class_no}"></th>
                <th style="width: 30%" th:text="${studentList.personCount}"></th>
                <th>
                    <th:block th:if="${examSymbol==null}">
                        <span><button th:onclick="studentPage.addStudent([[${studentList.grade+'-'+studentList.major+'-'+studentList.class_no}]])" class="button btn-success">  <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 添加学生</button></span>
                        <span><button th:onclick="studentPage.deleteClass([[${studentList.grade+'-'+studentList.major+'-'+studentList.class_no}]])" class="button btn-warning"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> 删除班级</button></span>
                    </th:block>
                    <span><button th:onclick="studentPage.classInfo([[${studentList.grade+'-'+studentList.major+'-'+studentList.class_no}]])" class="button btn-info"><span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>班级详情</button></span>
                </th>
            </tr>
        </th:block>
    </table>
    <th:block th:if="${pageVO!=null && pageVO.params.size()!=0}">
        <nav style="position: absolute;margin-top: 160px" aria-label="Page navigation">
            <ul class="pagination">
                <li th:if="${pageVO.page==1} " class="disabled">
                    <a href="javascript:void(0)" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <li th:unless="${pageVO.page==1}" >
                    <a th:onclick="|studentPage.limitQuery(${pageVO.page}-1)|" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>


                <li  th:class="${pageVO.page==index?'active':''}" th:each="index:${#numbers.sequence(pageVO.pageStart,pageVO.pageEnd)}" th:value="${index}">
                    <a th:onclick="|studentPage.limitQuery(${index})|" th:text="${index}"></a>
                </li>


                <li th:if="${pageVO.page==pageVO.realPage}" class="disabled">
                    <a href="javascript:void(0)" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
                <li th:unless="${pageVO.page==pageVO.realPage}" >
                    <a th:onclick="|studentPage.limitQuery(${pageVO.page}+1)|" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>
    </th:block>
</div>
</body>

</html>